﻿using B.S.BaseData.ErrorCode;
using B.S.BaseData.Manage.Api.Read.Apilaction.Command.ProductModelCommand;
using B.S.Passport.Domain;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.BaseData.Manage.Api.Read.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProductController : ControllerBase
    {
        private readonly IMediator mediator;

        public ProductController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 产品显示全部
        /// </summary>
        /// <param name="request">请求</param>
        /// <returns>返回任务</returns>
        [HttpGet]
        public async Task<ApiReqult<ApIPageing<ProductModel>>> ProductQuser([FromQuery] ProductQuserModelCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 批量产品显示全部
        /// </summary>
        /// <param name="request">请求</param>
        /// <returns>返回任务</returns>
        [HttpGet]
        public async Task<ApiReqult<List<ProductModel>>> ProductModelPhto([FromQuery] ProductModelPhtoCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
